
    function DoNav(theUrl) {
        document.location.href = theUrl;
    }
    (function(i, s, o, g, r, a, m) {
        i['GoogleAnalyticsObject'] = r;
        i[r] = i[r] ||
            function() {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
        a = s.createElement(o), m = s.getElementsByTagName(o)[0];
        a.async = 1;
        a.src = g;
        m.parentNode.insertBefore(a, m)
    })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
    ga('create', 'UA-47132172-1', 'dotamax.com');
    ga('send', 'pageview');


    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "//hm.baidu.com/hm.js?575895fe09d48554a608faa5ef059555";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();


        var num = parseInt(Math.random()*5+1);
        document.body.style.backgroundImage="url(http://cdn.maxjia.com/image/p_0"+num+".jpg)";

 
document.getElementById("rsa_n").value = "B81E72A33686A201B0AC009D679750990E3D168670DC6F9452C24E5A4C299AC002C6C89C3CB38784AEA95D66B7B3E9CA950EB9EEFB4EF61383EDDB67C35727F9CA87EE3238346C66D042B35812179501F472AD4F3BA19E701256FE0435AB856E5C5BEA24A2387153023CD4CD43CDA7260FCC1E2E49C14102C253F559F9A45D59DF5004A017B1239448A9A001D276CAD12535DEDE89FFBD57D75BBC9B575530DDD1B7FAD46064AD3C640CBD017F58981215B2EE17CBE175C36570C5235902818648577234E70E81133B088164F98E605D0D6E69A6095A32A72511E9AC901727B635CE2E8002A7B0EC8D012606903BCB825E60C7B6619FFCED4401E693F5EC68AB"
document.getElementById("login-btn").onclick = function(){
  do_encrypt();
  document.getElementById('login_form').submit();
  //debugger;
}
function do_encrypt(){
    //var before = new Date();
    var rsa = new RSAKey();
    rsa.setPublic(document.getElementById("rsa_n").value, document.getElementById("rsa_e").value);
    var phoneNum = rsa.encrypt(document.getElementById("phoneNum").value);
    var username = rsa.encrypt(document.getElementById("username").value);
    var password = rsa.encrypt(document.getElementById("password").value);
    //var after = new Date();
    if(phoneNum){
      //document.rsa.ciphertext.value = linebrk(res, 64);
      document.rsa.phoneNumCipherb64.value = linebrk(hex2b64(phoneNum), 64);
      //document.rsa.status.value = "Time: " + (after - before) + "ms";
    }
    if(username){
      document.rsa.usernameCipherb64.value = linebrk(hex2b64(username), 64);
    }
    if(password){
      document.rsa.passwordCipherb64.value = linebrk(hex2b64(password), 64);
    }
}
function show_div(){
  document.getElementById("account-type").value='1';
  document.getElementById("password").value='';
  document.getElementById("username").style.display='none';
  document.getElementById("username").setAttribute("name","");
  document.getElementById("phoneNum").style.display='';
  document.getElementById("phoneNum").setAttribute("name","phoneNum");
  document.getElementById("phoneLog").style.cssText="border-bottom: 1px solid white;color: white;"  
  document.getElementById("webLog").style.cssText="border-bottom: 1px solid rgba(50,50,50,0);"  
}
function show_div1(){
  document.getElementById("account-type").value='2';
  document.getElementById("password").value='';
  document.getElementById("username").style.display='';
  document.getElementById("username").setAttribute("name","username");
  document.getElementById("phoneNum").style.display='none';
  document.getElementById("phoneNum").setAttribute("name","");
  document.getElementById("webLog").style.cssText="border-bottom: 1px solid white;color: white;"
  document.getElementById("phoneLog").style.cssText="border-bottom: 1px solid rgba(50,50,50,0);"
}

document.onkeydown = function(){
    if(event.keyCode==13){
        document.getElementById("login-btn").click();   
        return false;                               
    }
}



particlesJS('particles-js',
  {
    "particles": {
      "number": {
        "value": 110,
        "density": {
          "enable": true,
          "value_area": 800
        }
      },
      "color": {
        "value": "#ffffff"
      },
      "shape": {
        "type": "circle",
        "stroke": {
          "width": 0,
          "color": "#000000"
        },
        "polygon": {
          "nb_sides": 5
        },
        "image": {
          "src": "img/github.svg",
          "width": 100,
          "height": 100
        }
      },
      "opacity": {
        "value": 0.5,
        "random": false,
        "anim": {
          "enable": false,
          "speed": 1,
          "opacity_min": 0.1,
          "sync": false
        }
      },
      "size": {
        "value": 1,
        "random": true,
        "anim": {
          "enable": false,
          "speed": 20,
          "size_min": 0.1,
          "sync": false
        }
      },
      "line_linked": {
        "enable": true,
        "distance": 40,
        "color": "#fff",
        "opacity": 1,
        "width": 1
      },
      "move": {
        "enable": true,
        "speed": 3,
        "direction": "none",
        "random": false,
        "straight": false,
        "out_mode": "out",
        "attract": {
          "enable": false,
          "rotateX": 600,
          "rotateY": 1200
        }
      }
    },
    "interactivity": {
      "detect_on": "canvas",
      "events": {
        "onhover": {
          "enable": true,
          "mode": "grab"
        },
        "onclick": {
          "enable": true,
          "mode": "push"
        },
        "resize": true
      },
      "modes": {
        "grab": {
          "distance": 120,
          "line_linked": {
            "opacity": 1
          }
        },
        "bubble": {
          "distance": 400,
          "size": 40,
          "duration": 2,
          "opacity": 8,
          "speed": 3
        },
        "repulse": {
          "distance": 300
        },
        "push": {
          "particles_nb": 4
        },
        "remove": {
          "particles_nb": 2
        }
      }
    },
    "retina_detect": true,
    "config_demo": {
      "hide_card": false,
      "background_color": "#b61924",
      "background_image": "",
      "background_position": "50% 50%",
      "background_repeat": "no-repeat",
      "background_size": "cover"
    }
  }

);
